package com.taobao.server.impl;

import org.eclipse.swt.graphics.Image;

import com.taobao.dao.ValidateCodeDao;
import com.taobao.server.CommonServer;
import com.taobao.server.ValidateCodeServer;

public class ValidateCodeServerImpl extends CommonServer implements ValidateCodeServer {

    private ValidateCodeDao validateCodeDao;

    @Override
    public Image getValidateCode() {
        Image image = null;
        while (true) {
            try {
                if ((image = validateCodeDao.getValidateImage()) == null) {
                    continue;
                } else {
                    break;
                }
            } catch (Exception e) {
                e.printStackTrace();
                continue;
            }
        }
        return image;
    }
}
